home *** CD-ROM | disk | FTP | other *** search
/ Mission 3 / Mission 3.zip / Mission 3.iso / texte / qed / src / types.h < prev    next >
C/C++ Source or Header  |  1998-10-19  |  5KB  |  166 lines

  1. #ifndef _qed_types_h_
  2. #define _qed_types_h_
  3.  
  4.  
  5. #define SETSIZE    32                            /* Größe eines Sets in Longs */
  6. #define SETMAX        (SETSIZE*32 - 1)        /* Maximale Elemente eines Sets */
  7.  
  8. typedef unsigned long    SET[SETSIZE];            /* Menge */
  9.  
  10. /*
  11.  * Dateinamen, Pfade, Dateiauswahl 
  12. */
  13. #define MAX_PATH_LEN    256
  14. typedef char PATH[MAX_PATH_LEN];
  15.  
  16. #define MAX_NAME_LEN    64
  17. typedef char FILENAME[MAX_NAME_LEN];
  18.  
  19. /* Aufzählnungtypen */
  20. typedef enum {tos, unix, apple, binmode} LINEENDING;
  21.  
  22. typedef enum {Atari, Latin, Mac, PC, LaTeX, HTML, ASCII} UMLAUTENCODING;
  23.  
  24. typedef enum {POS_CHANGE, LINE_CHANGE, TOTAL_CHANGE, NOP_CHANGE, SCROLL_UP,
  25.                   SCROLL_DOWN, MOVE_UP, MOVE_DOWN, BLK_CHANGE, WT_CHANGE} CHANGE;
  26.  
  27. typedef enum {FALSE, TRUE} bool;
  28.  
  29. typedef struct                                                                
  30. {                                                                             
  31.     long    x;                                                              
  32.     long    y;                                                              
  33.     long    w;                                                              
  34.     long    h;                                                              
  35. } LRECT;                                                                      
  36.  
  37. #define MUSTER_LEN    7
  38.  
  39. typedef struct
  40. {
  41.     char            muster[MUSTER_LEN + 1];    /* Datei-Maske */
  42.     bool            tab;
  43.     int            tabsize;
  44.     bool            einruecken;
  45.     bool            umbrechen;
  46.     bool            format_by_load;
  47.     bool          format_by_paste;
  48.     int            lineal_len;
  49.     char            umbruch_str[35];
  50.     SET            umbruch_set;
  51.     bool            backup;
  52.     char            backup_ext[4];
  53.     PATH            kurzel;
  54.     char            wort_str[34];
  55.     SET            wort_set;
  56.     bool            show_end;
  57. } LOCOPT, *LOCOPTP;
  58.  
  59.  
  60. typedef struct _zeile
  61. {
  62.     struct _zeile     *vorg;
  63.     struct _zeile     *nachf;
  64.     char                info;
  65.     int                len;                    /* Länge in Bytes */
  66.     bool                is_longest;
  67.     int                exp_len;                /* expandierte Länge */
  68. } ZEILE, *ZEILEP;
  69.  
  70.  
  71. typedef struct
  72. {
  73.     ZEILE                head;
  74.     ZEILE                tail;
  75.     long              lines;
  76.     LINEENDING        ending;                /* Zeilenende */
  77.     unsigned short    max_line_len;        /* Maximale Zeilenlänge */
  78. } RING, *RINGP;
  79.  
  80.  
  81. typedef struct _text
  82. {
  83.     struct _text     *next;
  84.     int                link;                    /* Fensterhandle */
  85.     RING                text;                    /* Der Text */
  86.     long                file_date_time;    /* Datei-Datum und Zeit */
  87.     ZEILEP            cursor_line;      /* zeigt auf aktuellen Textzeile */
  88.     int                xpos;                /* x-Position des Cursors im Text */
  89.     long                ypos;                    /* y-Position des Cursors im Text */
  90.     long                moved;                /* Text wurde seit letztem Sichern verändert */
  91.     ZEILEP            p1,p2;                /* Zeiger für Block */
  92.     long                z1,z2;                /* ZeilenNr. für p1 und p2 */
  93.     int                x1,x2;                /* X-Pos für Block-Anfang und Ende */
  94.     bool                cursor;                /* Cursor anzeigen */
  95.     bool                block;                /* Es gibt einen Block */
  96.     bool                blink;                /* Cursor ist gerade wg. Blinken aus */
  97.     bool                block_dir;            /* Blockrichtung laut Eingabe */
  98.     bool                up_down;                /* War letzte Operation Up oder Down */
  99.     bool                blk_mark_mode;        /* Block wird durch Cursor aufgezogen */
  100.     bool                readonly;            /* Datei auf Disk schreibgeschützt */
  101.     int                desire_x;            /* Für UP und DOWN in [TASTEN] */
  102.     char                info_str[256];        /* Text, der im Fenster-Info ausgegeben wird */
  103.     PATH                filename;            /* Name der Datei */
  104.     int                filesys;                /* Ergebnis von fs_case_sens(filename) */
  105.     bool                namenlos;            /* Datei hat noch keinen Name */
  106.     LOCOPTP            loc_opt;                /* Zeiger auf lokalen Optionen */
  107.     long                asave;                /* letzter Autosave (min) */
  108.     ZEILEP            max_line;            /* längeste Zeile */
  109. } TEXT, *TEXTP;
  110.  
  111. typedef void (*TEXT_DOFUNC)(TEXTP t_ptr);
  112.  
  113. #define WINSTRLEN    128
  114. typedef struct _window
  115. {
  116.     struct _window    *next;
  117.     int                class;                /* Klasse des Fensters */
  118.     int                init;                    /* Nummer des Fensters für die Konfig */
  119.     int                handle;                /* Handle für Fenster */
  120.     int                kind;                    /* Art des Fensters */
  121.     int                flags;                /* Flags des Fensters */
  122.     LRECT                doc;                    /* Position und Größe des Dokumentes */
  123.     int                xfac;                    /* X-Factor des Dokumentes */
  124.     int                yfac;                    /* Y-Factor des Dokumentes */
  125.     int                w_width;                /* Fensterbreite in Einheiten */
  126.     int                w_height;            /* Fensterhöhe in Einheiten */
  127.     GRECT                work;                    /* Arbeitsbereich */
  128.     char                title[WINSTRLEN];    /* Titel des Fensters (mit ' ' und '*') */
  129.     char                info[WINSTRLEN];    /* Infozeile des Fensters */
  130.     int                icon_x, icon_y;    /* Position des Icons */
  131.     GRECT                old_size;            /* Absolute Größe vor dem Iconify */
  132.  
  133.     void                (*draw)            (struct _window *window, GRECT *d);
  134.     void                (*snap)            (struct _window *window, GRECT *new, int mode);
  135.     void                (*click)            (struct _window *window, int m_x, int m_y, int bstate, int kstate, int breturn);
  136.     void                (*unclick)        (struct _window *window);
  137.     bool                (*key)            (struct _window *window, int kstate, int kreturn);
  138.     void                (*top)            (struct _window *window);
  139.     void                (*ontop)            (struct _window *window);
  140.     void                (*untop)            (struct _window *window);
  141.     void                (*bottom)        (struct _window *window);
  142.     void                (*close)            (struct _window *window);
  143.     void                (*iconify)        (struct _window *window);
  144.     void                (*uniconify)    (struct _window *window);
  145. } WINDOW, *WINDOWP;
  146.  
  147. typedef void (*WIN_DOFUNC)(WINDOWP w);
  148. typedef void (*WIN_CRTFUNC)(WINDOWP w);
  149.  
  150. typedef struct 
  151. {
  152.     char    name[9];        /* GEM-Name der Shell */
  153.     PATH    makefile;
  154. } SHELLENTRY;
  155.  
  156.  
  157. typedef struct _posentry
  158. {
  159.     struct _posentry    *next;
  160.     PATH                    filename;
  161.     long                    zeile;
  162.     int                    spalte;
  163. } POSENTRY;
  164.  
  165. #endif
  166.